package cn.itcast.springboot.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.sql.DataSource;


@RestController // 都应该返回JSON类型的数据
@RequestMapping("hello")
public class HelloController {

    private final DataSource dataSource;

    @Autowired
    public HelloController(DataSource dataSource) {
        this.dataSource = dataSource;
    }


    @GetMapping("show")
    public String test() {
        return "Hello springboot 1";
    }


}
